export default function (fn, duration) {
	let timer = null
	return function (...args) {
		clearTimeout(timer)
		timer = setTimeout(() => {
			fn.call(this, ...args)
		}, duration)
	}
}
